home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
3DMAZE
/
DRAWMAZE.C
< prev
next >
Wrap
Text File
|
1991-02-16
|
2KB
|
84 lines
/******************************************************
*
* DrawMaze.c v. 1.0
* 1991 By Mark Frohnmayer
*
* NOTE - This header must appear at the beginning of all 3-D maze files!
*
* If you have any comments or recommended modifications for this code,
* email me on America On-Line at "Mark Frohn" or snail mail me at:
*
* Mark Frohnmayer
* 2875 Baker Blvd
* Eugene, OR 97403
*
* If you use this code in any program, commercial or otherwise, give
* me credit in the about box.
*
* THIS CODE MAY NOT BE SOLD OR DISTRIBUTED AT COST OR AS PART OF SOLD
* PACKAGE WITHOUT PRIOR WRITTEN CONSENT OF THE AUTHOR.
*
******************************************************/
#include "MazeData.h"
extern WindowPtr MyWindow;
void DrawMaze()
{
register int i;
CopyBits(&(MazeImage[0]), &(MazeImage[6]), &MazeRect,
&MazeRect, srcCopy, 0L);
for(i = 0; i < 5; i++) {
if(uview.rows[i][0]) {
CopyBits(&(MazeImage[1]), &(MazeImage[6]), &viewRects[i],
&viewRects[i], srcCopy, 0L);
}
}
if(uview.rows[0][1]) {
CopyBits(&(MazeImage[4]), &(MazeImage[6]), &viewRects[0],
&viewRects[0], srcCopy, 0L);
}
if(uview.rows[4][1]) {
CopyBits(&(MazeImage[4]), &(MazeImage[6]), &viewRects[4],
&viewRects[4], srcCopy, 0L);
}
if(uview.rows[1][1]) {
CopyBits(&(MazeImage[5]), &(MazeImage[6]), &viewRects[12],
&viewRects[12], srcCopy, 0L);
}
if(uview.rows[3][1]) {
CopyBits(&(MazeImage[5]), &(MazeImage[6]), &viewRects[13],
&viewRects[13], srcCopy, 0L);
}
for(i=1; i<4;i++) {
if(uview.rows[i][1]) {
CopyBits(&(MazeImage[2]), &(MazeImage[6]), &viewRects[i+4],
&viewRects[i+4], srcCopy, 0L);
}
}
for(i=1; i<4;i+=2) {
if(uview.rows[i][2]) {
CopyBits(&(MazeImage[3]), &(MazeImage[6]), &viewRects[i+7],
&viewRects[i+7], srcCopy, 0L);
CopyBits(&(MazeImage[5]), &(MazeImage[6]), &viewRects[11 + (i-1) / 2 * 3],
&viewRects[11 + (i-1) / 2 * 3], srcCopy, 0L);
}
}
if(uview.rows[2][2]) {
CopyBits(&(MazeImage[3]), &MazeImage[6], &viewRects[9],
&viewRects[9], srcCopy, 0L);
}
if(uview.rows[1][3]) {
CopyBits(&(MazeImage[5]), &MazeImage[6], &viewRects[8],
&viewRects[8], srcCopy, 0L);
}
if(uview.rows[3][3]) {
CopyBits(&(MazeImage[5]), &MazeImage[6], &viewRects[10],
&viewRects[10], srcCopy, 0L);
}
CopyBits(&(MazeImage[6]), &MyWindow->portBits, &MazeRect,
&MazeRect, srcCopy, 0L);
}